import storageApi from '../../core/storage/storage';

function bidTabsController($rootScope, $scope, globalService) {
  'ngInject';

  /*eslint-disable */
  $scope.$watch('$bidTabsCtrl.type', (newValue) => {
    if (newValue) {
      globalService.getUserManageRange(newValue)
      .then((res) => {
        if (res.success && res.rows.length > 0) {
          this.list = res.rows;
          this.ngModel = res.rows[0];
        }
      });
    } else {
      globalService.getConsManageRange()
      .then((res) => {
        if (res.success && res.rows.length > 0) {
          this.list = res.rows;
          this.ngModel = res.rows[0];
        }
      });
    }
  });

};

export default bidTabsController;
